package com.hotel.controller;


import com.hotel.entity.OrderDetail;
import com.hotel.response.Result;
import com.hotel.service.OrderDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 订单明细表 前端控制器
 * </p>
 *
 * @author Lin
 * @since 2022-06-13
 */
@Api(tags = "订单详情")
@RestController
@RequestMapping("/orderDetail")
public class OrderDetailController {

    @Resource
    private OrderDetailService service;

    @ApiOperation(value = "查看订单详情")
    @GetMapping("/getOrderDetail")
    public Result getOrderDetail(@RequestParam(value = "orderId") String orderId){
        List<OrderDetail> orderDetail = service.getOrderDetail(orderId);
        return Result.ok().data("orderDetail",orderDetail);
    }

}

